function tests(verbose, rng)
if nargin < 1
    verbose = 0;
end
if isunix()
    prefix = '/media/win_c/';
else
    prefix = 'C:/';
end
CoverPath = [prefix, 'BossBase-1.0-cover/'];
StegoPath = [prefix, 'BossBase-1.0-hugo-alpha=0.4/'];

flist1 = dir([CoverPath,'*.pgm']);
flist2 = dir([StegoPath,'*.pgm']);
flen1 = length(flist1);
flen2 = length(flist2);
if (flen1 ~= flen2)
    error('file list size not match');
end

if nargin < 2
    rng = [1 10000];
end
mint = rng(1);
maxt = rng(2);
if (maxt > flen1)
    error('wrong range');
end
load('filter.mat', 'stat', 'f', 'ff');

count = stat.count;
v = stat.v;

res = struct();
for num = maxt:-1:mint
    Cname = [CoverPath, flist1(num).name];
    imgC = double(imread(Cname));
    Sname = [StegoPath, flist2(num).name];
    imgS = double(imread(Sname));
    fprintf('%d : %s & %s',num, Cname,Sname);
    for j = 1:count
        fa = squeeze(f(v(j,1),:,:));
        fb = squeeze(f(v(j,2),:,:));
        fc = squeeze(ff(j,:,:));
        pa = conv2(imgC, fa, 'valid') >= 0;
        pb = conv2(imgC, fb, 'valid') >= 0;
        pc = conv2(imgC, fc, 'valid') >= 0;
        
        s = numel(pa);
        res(num,j).total = s; % TOTAL
        u = find(pa ~= pb);
        res(num,j).diff_a_b = length(u) / s; % A<>B
        res(num,j).c_1 = sum(pc(u));
        res(num,j).c_0 = length(u) - sum(pc(u));
        ab = (pc ~= (pa | pb));
        res(num,j).diff_c_ab = nnz(ab); % C(A<>B) ~= A|B
        res(num,j).pdiff_c_ab = nnz(ab) / length(u); 

        pd = conv2(imgS, fc, 'valid') >= 0;
        df = (pc ~= pd);
        res(num, j).diff_C_S = nnz(df); % Cover ~= Stego
        res(num, j).pdiff_C_S = nnz(df) / length(u);
        fprintf('.');
    end
    %save result.mat -append res
    fprintf('\n');
end
save result.mat res
end